is string empty?

Hi,
Mr.Ferrari - Wed Jun 03 11:08:59 EDT 2009

Re: is string empty?
Tony_Goodman - Thu Jun 04 02:50:22 EDT 2009

Hi.

Re: is string empty?
Mr.Ferrari - Thu Jun 04 04:56:43 EDT 2009

Tony_Goodman - Thu Jun 04 02:50:22 EDT 2009
Hi.

hehe... I know it's a stupid entry but I could't find anything to edit or remove it ;-)... sorry.

Re: is string empty?
llandale - Fri Jun 05 12:47:31 EDT 2009

I haven't quite figured it out yet, but 'null' isn't quite the same as "" for strings. I don't recall the symptoms, but I've had to insert the following in some of my scripts to make them work:

if (null Value) Value = ""

I think it has to do with Value being either a call parameter from some function(), or the function return value.

-Louie

Re: is string empty?
Tony_Goodman - Mon Jun 08 02:40:01 EDT 2009

llandale - Fri Jun 05 12:47:31 EDT 2009
I haven't quite figured it out yet, but 'null' isn't quite the same as "" for strings. I don't recall the symptoms, but I've had to insert the following in some of my scripts to make them work:

if (null Value) Value = ""

I think it has to do with Value being either a call parameter from some function(), or the function return value.

-Louie

I never figured this out either, and I too convert null strings to empty strings.

When testing a string value for null, especially one returned from a builtin function, I use the following. By concatenating an empty string before the comparison this works for empty string as well as null strings.



if (s 
"" == 
"") 
{ 
// do stuff 
}

As Louie says, the following is not guaranteed to work:



if (

null s) 
{ 
// do stuff 
}